home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / H-I / HDA Tech Note #1.cpt / HDA Tech Note #1 / card_7208.txt < prev    next >
Text File  |  1989-02-26  |  2KB  |  61 lines

  1. -- card: 7208 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 2619
  5. -- name: WAITING for the USER
  6.  
  7.  
  8. -- part 1 (field)
  9. -- low flags: 01
  10. -- high flags: 0001
  11. -- rect: left=37 top=42 right=91 bottom=475
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 3
  16. -- text size: 12
  17. -- style flags: 8448
  18. -- line height: 16
  19. -- part name: 
  20.  
  21.  
  22. -- part contents for card part 1
  23. ----- text -----
  24. General Design Principles
  25.  
  26. WAITING for the USER
  27.  
  28. -- part contents for background part 2
  29. ----- text -----
  30. One of the most commonly used features in HyperCard is that of showing the user some information and then waiting for him to press the mouse button before proceeding.  This pause is generally executed by the command:
  31.  
  32. wait until the mouseClick
  33.  
  34. But HyperDA does not support the wait command, so this won‚Äôt work in HyperDA.  As a consequence, you might show the user a field, for example, and hide it so quickly he never gets a chance to read its contents.
  35.  
  36. But since we can use the hide and show commands in HyperDA, you can create a transparent button the size of a card that you show at the same time as you show the field you want the user to read.  Program this button so that it disappears, hides the field, and proceeds with processing when the user presses it.  Then because it covers the entire card and is transparent, anywhere the user clicks will have the desired consequences.
  37.  
  38. For example, suppose you want to have the field called ‚ÄúUser Help‚Äù display when the user presses a certain button on a card and to stay visible until the user clicks somewhere on the card.  In HyperCard, you would probably be inclined to write a handler like this:
  39.  
  40. on mouseUp
  41.   show card field ‚ÄúUser Help‚Äù
  42.   wait until the mouseClick
  43.   hide card field ‚ÄúUser Help‚Äù
  44. end mouseUp
  45.  
  46. Here‚Äôs how you could do the same thing in HyperDA, using a transparent button called cardCover:
  47.  
  48. on mouseUp
  49.   show card field ‚ÄúUser Help‚Äù
  50.   show card button ‚ÄúcardCover‚Äù
  51. end mouseUp
  52.  
  53. Then in the script of the button ‚ÄúcardCover,‚Äù you‚Äôd include:
  54.  
  55. on  mouseUp
  56.   hide card field ‚ÄúUser Help‚Äù
  57.   hide card button ‚ÄúcardCover‚Äù
  58.   go to card 14 -- or whatever other processing you wanted, if any
  59. end mouseUp
  60.  
  61.